{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "23ef5af4",
   "metadata": {},
   "source": [
    "# 1. Web服务API简介 \n",
    "> 高德Web服务API向开发者提供HTTP接口，开发者可通过这些接口使用各类型的地理数据服务，返回结果支持JSON和XML格式。\n",
    "\n",
    "> Web服务API对所有用户开放。使用本组服务之前，需要申请应用Key。不同类型用户可获取不同的数据访问能力。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c6b84dd1",
   "metadata": {},
   "source": [
    "# 2. 测试API功能"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "74e29c5c",
   "metadata": {},
   "source": [
    "## 2.1  地理/逆地理编码\n",
    "* 结构化地址:\n",
    ">首先，地址肯定是一串字符，内含国家、省份、城市、区县、城镇、乡村、街道、门牌号码、屋邨、大厦等建筑物名称。按照由大区域名称到小区域名称组合在一起的字符。一个有效的地址应该是独一无二的。注意：针对大陆、港、澳地区的地理编码转换时可以将国家信息选择性的忽略，但省、市、城镇等级别的地址构成是不能忽略的。暂时不支持返回台湾省的详细地址信息。\n",
    "\n",
    "* 结构化地址<--->经纬度\n",
    ">地理编码/逆地理编码 API 是通过 HTTP/HTTPS 协议访问远程服务的接口，提供结构化地址与经纬度之间的相互转化的能力"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "56df8a05",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 调用 requests 模块 （比作 打开 Google Chrome 浏览器）\n",
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "463ddc0e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 2. 请求的地址URL：https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "geo_url = \"https://restapi.amap.com/v3/geocode/geo?parameters\"\n",
    "\n",
    "# 3. 请求方式 ： GET\n",
    "\n",
    "# 4.请求参数 \n",
    "payload = {\n",
    "    \"key\":\"63828d7ead48d69fa71280667a6f3145\",\n",
    "    \"address\":\"广东省广州市从化区中山大学南方学院\"\n",
    "}\n",
    "\n",
    "# 5. 发起请求\n",
    "r = requests.get(url = geo_url,params = payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "b11e0912",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "3542894f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'count': '1',\n",
       " 'geocodes': [{'formatted_address': '广东省广州市从化区中山大学南方学院',\n",
       "   'country': '中国',\n",
       "   'province': '广东省',\n",
       "   'citycode': '020',\n",
       "   'city': '广州市',\n",
       "   'district': '从化区',\n",
       "   'township': [],\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'adcode': '440117',\n",
       "   'street': [],\n",
       "   'number': [],\n",
       "   'location': '113.679287,23.632575',\n",
       "   'level': '兴趣点'}]}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "39c6262b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'113.679287,23.632575'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "广州南方学院_location = r.json()['geocodes'][0]['location']\n",
    "广州南方学院_location"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b41f0ff3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "ed1b1ee8",
   "metadata": {},
   "outputs": [],
   "source": [
    "## 2.2 逆地理编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "3e040dbb",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. 调用requests模块（google chrome 浏览器）\n",
    "import requests\n",
    "# 2. 请求方法 ： GET\n",
    "# 3. URL地址 ： https://restapi.amap.com/v3/geocode/geo?parameters\n",
    "regeo_url = \"https://restapi.amap.com/v3/geocode/regeo?parameters\"\n",
    "# 4. 准备参数，用于交换数据 payload\n",
    "payload = {\n",
    "    \"key\":\"63828d7ead48d69fa71280667a6f3145\",\n",
    "    \"location\":广州南方学院_location,\n",
    "    \"extensions\":\"all\",\n",
    "    \"poitype\":\"true\"\n",
    "}\n",
    "# 5. 发起请求\n",
    "r = requests.get(url = regeo_url, params = payload)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "338280c3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "dd4003dd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>type</th>\n",
       "      <th>tel</th>\n",
       "      <th>direction</th>\n",
       "      <th>distance</th>\n",
       "      <th>location</th>\n",
       "      <th>address</th>\n",
       "      <th>poiweight</th>\n",
       "      <th>businessarea</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>B00140MR9A</td>\n",
       "      <td>广州南方学院</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>020-87828988;020-61787331</td>\n",
       "      <td>西</td>\n",
       "      <td>3.06387</td>\n",
       "      <td>113.679257,23.632577</td>\n",
       "      <td>温泉大道882号</td>\n",
       "      <td>0.450402</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B0HGDU99RM</td>\n",
       "      <td>广州南方学院图书馆</td>\n",
       "      <td>科教文化服务;图书馆;图书馆</td>\n",
       "      <td>020-61787368;020-61787371</td>\n",
       "      <td>西北</td>\n",
       "      <td>23.6163</td>\n",
       "      <td>113.679177,23.632762</td>\n",
       "      <td>温泉大道882号广州南方学院内</td>\n",
       "      <td>0.257947</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>B0HGD58NF8</td>\n",
       "      <td>广州南方学院达人书院</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "      <td>[]</td>\n",
       "      <td>西南</td>\n",
       "      <td>32.2733</td>\n",
       "      <td>113.679041,23.632392</td>\n",
       "      <td>温泉大道882号广州南方学院新综合楼2层</td>\n",
       "      <td>0.191229</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>B0HGD58FR2</td>\n",
       "      <td>广州南方学院教学楼9号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>69.1226</td>\n",
       "      <td>113.679747,23.633032</td>\n",
       "      <td>广州南方学院</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>B0HGDU92JC</td>\n",
       "      <td>广州南方学院4号实验楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>东</td>\n",
       "      <td>69.4077</td>\n",
       "      <td>113.679963,23.632652</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>B0HGD599JM</td>\n",
       "      <td>广州南方学院第11教学楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>101.294</td>\n",
       "      <td>113.680037,23.633173</td>\n",
       "      <td>温泉大道882号广州南方学院</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>B0HG5Z9JNK</td>\n",
       "      <td>广州南方学院教学楼7号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西北</td>\n",
       "      <td>109.298</td>\n",
       "      <td>113.678600,23.633330</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.221553</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>B0HGDU7T1K</td>\n",
       "      <td>广州南方学院教学楼10号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>132.988</td>\n",
       "      <td>113.680125,23.633492</td>\n",
       "      <td>从莞深高速(广州南方学院)</td>\n",
       "      <td>0.191229</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>B0HGD592BJ</td>\n",
       "      <td>广州南方学院综合楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>东南</td>\n",
       "      <td>142.466</td>\n",
       "      <td>113.680117,23.631544</td>\n",
       "      <td>温泉大道886号广州南方学院内</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>B0H25SMRKP</td>\n",
       "      <td>广州南方学院大礼堂</td>\n",
       "      <td>科教文化服务;会展中心;会展中心</td>\n",
       "      <td>[]</td>\n",
       "      <td>东南</td>\n",
       "      <td>143.881</td>\n",
       "      <td>113.680076,23.631502</td>\n",
       "      <td>温泉大道882号</td>\n",
       "      <td>0.261624</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>B0HGDU6Z41</td>\n",
       "      <td>广州南方学院教学楼6号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西北</td>\n",
       "      <td>153.818</td>\n",
       "      <td>113.678424,23.633710</td>\n",
       "      <td>温泉大道882</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>B0HGD580NZ</td>\n",
       "      <td>广州南方学院惟贤门</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西北</td>\n",
       "      <td>154.082</td>\n",
       "      <td>113.678437,23.633721</td>\n",
       "      <td>博学路7号附近</td>\n",
       "      <td>0.285712</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>B0FFKP81F4</td>\n",
       "      <td>政商研究院教学楼9号</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>163.951</td>\n",
       "      <td>113.679949,23.633919</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>B0HGDU8NLD</td>\n",
       "      <td>广州南方学院1号实验楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西南</td>\n",
       "      <td>172.86</td>\n",
       "      <td>113.678215,23.631370</td>\n",
       "      <td>博学路附近</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>B0HGD57E3S</td>\n",
       "      <td>广州南方学院政商研究院</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>195.914</td>\n",
       "      <td>113.680427,23.633994</td>\n",
       "      <td>温泉镇博学路广州南方学院9号教学楼</td>\n",
       "      <td>0.191229</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>B0HGDU76L1</td>\n",
       "      <td>广州南方学院教学楼5号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西北</td>\n",
       "      <td>201.138</td>\n",
       "      <td>113.678046,23.633982</td>\n",
       "      <td>中山路与博学路交叉口东南150米</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>B0HG3SCZP8</td>\n",
       "      <td>桃园三章（校内店）</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "      <td>18570627158</td>\n",
       "      <td>北</td>\n",
       "      <td>207.618</td>\n",
       "      <td>113.679685,23.634406</td>\n",
       "      <td>第五食堂1层8号教学楼对面</td>\n",
       "      <td>0.209855</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>B0HGDU76L2</td>\n",
       "      <td>广州南方学院2号实验楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西南</td>\n",
       "      <td>210.76</td>\n",
       "      <td>113.678211,23.630956</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>B00140TWHT</td>\n",
       "      <td>教工住宅1号</td>\n",
       "      <td>商务住宅;住宅区;住宅小区</td>\n",
       "      <td>[]</td>\n",
       "      <td>南</td>\n",
       "      <td>251.758</td>\n",
       "      <td>113.678490,23.630432</td>\n",
       "      <td>笃行路2</td>\n",
       "      <td>0.157653</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>B0HGD58UTT</td>\n",
       "      <td>广州南方学院8号教学楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>东北</td>\n",
       "      <td>225.543</td>\n",
       "      <td>113.680399,23.634329</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.191229</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>B0FFL7C054</td>\n",
       "      <td>广州U优森特酒店</td>\n",
       "      <td>住宿服务;住宿服务相关;住宿服务相关</td>\n",
       "      <td>15813395296</td>\n",
       "      <td>西南</td>\n",
       "      <td>8.10295</td>\n",
       "      <td>113.679226,23.632528</td>\n",
       "      <td>温泉镇博学路882号(广州南方学院商业中心1层)</td>\n",
       "      <td>0.317505</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>B0HGDU92JD</td>\n",
       "      <td>广州南方学院教学楼1号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西</td>\n",
       "      <td>241.753</td>\n",
       "      <td>113.677077,23.631783</td>\n",
       "      <td>博学路19号</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>B0HGDU8UYP</td>\n",
       "      <td>广州南方学院继续教育学院招生办</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>254.238</td>\n",
       "      <td>113.679075,23.634853</td>\n",
       "      <td>中山路</td>\n",
       "      <td>0.191229</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>B0FFLBEOND</td>\n",
       "      <td>聚贤楼10号</td>\n",
       "      <td>商务住宅;住宅区;宿舍</td>\n",
       "      <td>[]</td>\n",
       "      <td>东南</td>\n",
       "      <td>263.444</td>\n",
       "      <td>113.681253,23.631036</td>\n",
       "      <td>从莞深高速(广州南方学院)</td>\n",
       "      <td>0.190963</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>B0FFKP81F0</td>\n",
       "      <td>教学楼1号(文学与传媒学院)</td>\n",
       "      <td>科教文化服务;科教文化场所;科教文化场所</td>\n",
       "      <td>[]</td>\n",
       "      <td>西</td>\n",
       "      <td>263.674</td>\n",
       "      <td>113.676866,23.631736</td>\n",
       "      <td>博学路19号附近</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>B0HGD58UTU</td>\n",
       "      <td>广州南方学院2号教学楼</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西南</td>\n",
       "      <td>264.846</td>\n",
       "      <td>113.677060,23.631346</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.191229</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>B0FFKP838K</td>\n",
       "      <td>教学楼3号(外国语学院)</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西南</td>\n",
       "      <td>275.62</td>\n",
       "      <td>113.677247,23.630947</td>\n",
       "      <td>博学路25</td>\n",
       "      <td>0.191742</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>B0HGD588HJ</td>\n",
       "      <td>广州南方学院教学楼4号</td>\n",
       "      <td>科教文化服务;学校;学校</td>\n",
       "      <td>[]</td>\n",
       "      <td>西南</td>\n",
       "      <td>297.315</td>\n",
       "      <td>113.677460,23.630490</td>\n",
       "      <td>博学路</td>\n",
       "      <td>0.221662</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>B0GUJYPEG2</td>\n",
       "      <td>怒烤烤串(从化店)</td>\n",
       "      <td>餐饮服务;中餐厅;特色/地方风味餐厅</td>\n",
       "      <td>[]</td>\n",
       "      <td>西</td>\n",
       "      <td>219.859</td>\n",
       "      <td>113.677160,23.632910</td>\n",
       "      <td>温泉大道882号广州南方学院内博学路6号之3</td>\n",
       "      <td>0.216026</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>B0HGD576F1</td>\n",
       "      <td>广州南方学院音乐系</td>\n",
       "      <td>科教文化服务;学校;高等院校</td>\n",
       "      <td>[]</td>\n",
       "      <td>北</td>\n",
       "      <td>316.942</td>\n",
       "      <td>113.678792,23.635389</td>\n",
       "      <td>中山路</td>\n",
       "      <td>0.285712</td>\n",
       "      <td>[]</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            id             name                  type  \\\n",
       "0   B00140MR9A           广州南方学院        科教文化服务;学校;高等院校   \n",
       "1   B0HGDU99RM        广州南方学院图书馆        科教文化服务;图书馆;图书馆   \n",
       "2   B0HGD58NF8       广州南方学院达人书院  科教文化服务;科教文化场所;科教文化场所   \n",
       "3   B0HGD58FR2      广州南方学院教学楼9号          科教文化服务;学校;学校   \n",
       "4   B0HGDU92JC      广州南方学院4号实验楼          科教文化服务;学校;学校   \n",
       "5   B0HGD599JM     广州南方学院第11教学楼          科教文化服务;学校;学校   \n",
       "6   B0HG5Z9JNK      广州南方学院教学楼7号          科教文化服务;学校;学校   \n",
       "7   B0HGDU7T1K     广州南方学院教学楼10号          科教文化服务;学校;学校   \n",
       "8   B0HGD592BJ        广州南方学院综合楼          科教文化服务;学校;学校   \n",
       "9   B0H25SMRKP        广州南方学院大礼堂      科教文化服务;会展中心;会展中心   \n",
       "10  B0HGDU6Z41      广州南方学院教学楼6号          科教文化服务;学校;学校   \n",
       "11  B0HGD580NZ        广州南方学院惟贤门        科教文化服务;学校;高等院校   \n",
       "12  B0FFKP81F4       政商研究院教学楼9号        科教文化服务;学校;高等院校   \n",
       "13  B0HGDU8NLD      广州南方学院1号实验楼          科教文化服务;学校;学校   \n",
       "14  B0HGD57E3S      广州南方学院政商研究院  科教文化服务;科教文化场所;科教文化场所   \n",
       "15  B0HGDU76L1      广州南方学院教学楼5号          科教文化服务;学校;学校   \n",
       "16  B0HG3SCZP8        桃园三章（校内店）         商务住宅;住宅区;住宅小区   \n",
       "17  B0HGDU76L2      广州南方学院2号实验楼          科教文化服务;学校;学校   \n",
       "18  B00140TWHT           教工住宅1号         商务住宅;住宅区;住宅小区   \n",
       "19  B0HGD58UTT      广州南方学院8号教学楼          科教文化服务;学校;学校   \n",
       "20  B0FFL7C054         广州U优森特酒店    住宿服务;住宿服务相关;住宿服务相关   \n",
       "21  B0HGDU92JD      广州南方学院教学楼1号          科教文化服务;学校;学校   \n",
       "22  B0HGDU8UYP  广州南方学院继续教育学院招生办        科教文化服务;学校;高等院校   \n",
       "23  B0FFLBEOND           聚贤楼10号           商务住宅;住宅区;宿舍   \n",
       "24  B0FFKP81F0   教学楼1号(文学与传媒学院)  科教文化服务;科教文化场所;科教文化场所   \n",
       "25  B0HGD58UTU      广州南方学院2号教学楼          科教文化服务;学校;学校   \n",
       "26  B0FFKP838K     教学楼3号(外国语学院)        科教文化服务;学校;高等院校   \n",
       "27  B0HGD588HJ      广州南方学院教学楼4号          科教文化服务;学校;学校   \n",
       "28  B0GUJYPEG2        怒烤烤串(从化店)    餐饮服务;中餐厅;特色/地方风味餐厅   \n",
       "29  B0HGD576F1        广州南方学院音乐系        科教文化服务;学校;高等院校   \n",
       "\n",
       "                          tel direction distance              location  \\\n",
       "0   020-87828988;020-61787331         西  3.06387  113.679257,23.632577   \n",
       "1   020-61787368;020-61787371        西北  23.6163  113.679177,23.632762   \n",
       "2                          []        西南  32.2733  113.679041,23.632392   \n",
       "3                          []        东北  69.1226  113.679747,23.633032   \n",
       "4                          []         东  69.4077  113.679963,23.632652   \n",
       "5                          []        东北  101.294  113.680037,23.633173   \n",
       "6                          []        西北  109.298  113.678600,23.633330   \n",
       "7                          []        东北  132.988  113.680125,23.633492   \n",
       "8                          []        东南  142.466  113.680117,23.631544   \n",
       "9                          []        东南  143.881  113.680076,23.631502   \n",
       "10                         []        西北  153.818  113.678424,23.633710   \n",
       "11                         []        西北  154.082  113.678437,23.633721   \n",
       "12                         []        东北  163.951  113.679949,23.633919   \n",
       "13                         []        西南   172.86  113.678215,23.631370   \n",
       "14                         []        东北  195.914  113.680427,23.633994   \n",
       "15                         []        西北  201.138  113.678046,23.633982   \n",
       "16                18570627158         北  207.618  113.679685,23.634406   \n",
       "17                         []        西南   210.76  113.678211,23.630956   \n",
       "18                         []         南  251.758  113.678490,23.630432   \n",
       "19                         []        东北  225.543  113.680399,23.634329   \n",
       "20                15813395296        西南  8.10295  113.679226,23.632528   \n",
       "21                         []         西  241.753  113.677077,23.631783   \n",
       "22                         []         北  254.238  113.679075,23.634853   \n",
       "23                         []        东南  263.444  113.681253,23.631036   \n",
       "24                         []         西  263.674  113.676866,23.631736   \n",
       "25                         []        西南  264.846  113.677060,23.631346   \n",
       "26                         []        西南   275.62  113.677247,23.630947   \n",
       "27                         []        西南  297.315  113.677460,23.630490   \n",
       "28                         []         西  219.859  113.677160,23.632910   \n",
       "29                         []         北  316.942  113.678792,23.635389   \n",
       "\n",
       "                     address poiweight businessarea  \n",
       "0                   温泉大道882号  0.450402           []  \n",
       "1            温泉大道882号广州南方学院内  0.257947           []  \n",
       "2       温泉大道882号广州南方学院新综合楼2层  0.191229           []  \n",
       "3                     广州南方学院  0.221662           []  \n",
       "4                      博学路附近  0.221662           []  \n",
       "5             温泉大道882号广州南方学院  0.221662           []  \n",
       "6                        博学路  0.221553           []  \n",
       "7              从莞深高速(广州南方学院)  0.191229           []  \n",
       "8            温泉大道886号广州南方学院内  0.221662           []  \n",
       "9                   温泉大道882号  0.261624           []  \n",
       "10                   温泉大道882  0.221662           []  \n",
       "11                   博学路7号附近  0.285712           []  \n",
       "12                     博学路附近  0.191742           []  \n",
       "13                     博学路附近  0.221662           []  \n",
       "14         温泉镇博学路广州南方学院9号教学楼  0.191229           []  \n",
       "15          中山路与博学路交叉口东南150米  0.221662           []  \n",
       "16             第五食堂1层8号教学楼对面  0.209855           []  \n",
       "17                       博学路  0.221662           []  \n",
       "18                      笃行路2  0.157653           []  \n",
       "19                       博学路  0.191229           []  \n",
       "20  温泉镇博学路882号(广州南方学院商业中心1层)  0.317505           []  \n",
       "21                    博学路19号  0.221662           []  \n",
       "22                       中山路  0.191229           []  \n",
       "23             从莞深高速(广州南方学院)  0.190963           []  \n",
       "24                  博学路19号附近  0.191742           []  \n",
       "25                       博学路  0.191229           []  \n",
       "26                     博学路25  0.191742           []  \n",
       "27                       博学路  0.221662           []  \n",
       "28    温泉大道882号广州南方学院内博学路6号之3  0.216026           []  \n",
       "29                       中山路  0.285712           []  "
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.json_normalize(r.json()['regeocode']['pois'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "6b962ad4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'regeocode': {'formatted_address': '广东省广州市从化区温泉镇广州南方学院',\n",
       "  'addressComponent': {'country': '中国',\n",
       "   'province': '广东省',\n",
       "   'city': '广州市',\n",
       "   'citycode': '020',\n",
       "   'district': '从化区',\n",
       "   'adcode': '440117',\n",
       "   'township': '温泉镇',\n",
       "   'towncode': '440117100000',\n",
       "   'neighborhood': {'name': [], 'type': []},\n",
       "   'building': {'name': [], 'type': []},\n",
       "   'streetNumber': {'street': '博学路',\n",
       "    'number': '882号',\n",
       "    'location': '113.679226,23.632528',\n",
       "    'direction': '西南',\n",
       "    'distance': '8.10295'},\n",
       "   'businessAreas': [[]]},\n",
       "  'pois': [{'id': 'B00140MR9A',\n",
       "    'name': '广州南方学院',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': '020-87828988;020-61787331',\n",
       "    'direction': '西',\n",
       "    'distance': '3.06387',\n",
       "    'location': '113.679257,23.632577',\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.450402',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU99RM',\n",
       "    'name': '广州南方学院图书馆',\n",
       "    'type': '科教文化服务;图书馆;图书馆',\n",
       "    'tel': '020-61787368;020-61787371',\n",
       "    'direction': '西北',\n",
       "    'distance': '23.6163',\n",
       "    'location': '113.679177,23.632762',\n",
       "    'address': '温泉大道882号广州南方学院内',\n",
       "    'poiweight': '0.257947',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD58NF8',\n",
       "    'name': '广州南方学院达人书院',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '西南',\n",
       "    'distance': '32.2733',\n",
       "    'location': '113.679041,23.632392',\n",
       "    'address': '温泉大道882号广州南方学院新综合楼2层',\n",
       "    'poiweight': '0.191229',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD58FR2',\n",
       "    'name': '广州南方学院教学楼9号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '69.1226',\n",
       "    'location': '113.679747,23.633032',\n",
       "    'address': '广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU92JC',\n",
       "    'name': '广州南方学院4号实验楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '东',\n",
       "    'distance': '69.4077',\n",
       "    'location': '113.679963,23.632652',\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD599JM',\n",
       "    'name': '广州南方学院第11教学楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '101.294',\n",
       "    'location': '113.680037,23.633173',\n",
       "    'address': '温泉大道882号广州南方学院',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HG5Z9JNK',\n",
       "    'name': '广州南方学院教学楼7号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '109.298',\n",
       "    'location': '113.678600,23.633330',\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221553',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU7T1K',\n",
       "    'name': '广州南方学院教学楼10号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '132.988',\n",
       "    'location': '113.680125,23.633492',\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.191229',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD592BJ',\n",
       "    'name': '广州南方学院综合楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '东南',\n",
       "    'distance': '142.466',\n",
       "    'location': '113.680117,23.631544',\n",
       "    'address': '温泉大道886号广州南方学院内',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0H25SMRKP',\n",
       "    'name': '广州南方学院大礼堂',\n",
       "    'type': '科教文化服务;会展中心;会展中心',\n",
       "    'tel': [],\n",
       "    'direction': '东南',\n",
       "    'distance': '143.881',\n",
       "    'location': '113.680076,23.631502',\n",
       "    'address': '温泉大道882号',\n",
       "    'poiweight': '0.261624',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU6Z41',\n",
       "    'name': '广州南方学院教学楼6号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '153.818',\n",
       "    'location': '113.678424,23.633710',\n",
       "    'address': '温泉大道882',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD580NZ',\n",
       "    'name': '广州南方学院惟贤门',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '154.082',\n",
       "    'location': '113.678437,23.633721',\n",
       "    'address': '博学路7号附近',\n",
       "    'poiweight': '0.285712',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKP81F4',\n",
       "    'name': '政商研究院教学楼9号',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '163.951',\n",
       "    'location': '113.679949,23.633919',\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU8NLD',\n",
       "    'name': '广州南方学院1号实验楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '西南',\n",
       "    'distance': '172.86',\n",
       "    'location': '113.678215,23.631370',\n",
       "    'address': '博学路附近',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD57E3S',\n",
       "    'name': '广州南方学院政商研究院',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '195.914',\n",
       "    'location': '113.680427,23.633994',\n",
       "    'address': '温泉镇博学路广州南方学院9号教学楼',\n",
       "    'poiweight': '0.191229',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU76L1',\n",
       "    'name': '广州南方学院教学楼5号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '西北',\n",
       "    'distance': '201.138',\n",
       "    'location': '113.678046,23.633982',\n",
       "    'address': '中山路与博学路交叉口东南150米',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HG3SCZP8',\n",
       "    'name': '桃园三章（校内店）',\n",
       "    'type': '商务住宅;住宅区;住宅小区',\n",
       "    'tel': '18570627158',\n",
       "    'direction': '北',\n",
       "    'distance': '207.618',\n",
       "    'location': '113.679685,23.634406',\n",
       "    'address': '第五食堂1层8号教学楼对面',\n",
       "    'poiweight': '0.209855',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU76L2',\n",
       "    'name': '广州南方学院2号实验楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '西南',\n",
       "    'distance': '210.76',\n",
       "    'location': '113.678211,23.630956',\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B00140TWHT',\n",
       "    'name': '教工住宅1号',\n",
       "    'type': '商务住宅;住宅区;住宅小区',\n",
       "    'tel': [],\n",
       "    'direction': '南',\n",
       "    'distance': '251.758',\n",
       "    'location': '113.678490,23.630432',\n",
       "    'address': '笃行路2',\n",
       "    'poiweight': '0.157653',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD58UTT',\n",
       "    'name': '广州南方学院8号教学楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '东北',\n",
       "    'distance': '225.543',\n",
       "    'location': '113.680399,23.634329',\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191229',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFL7C054',\n",
       "    'name': '广州U优森特酒店',\n",
       "    'type': '住宿服务;住宿服务相关;住宿服务相关',\n",
       "    'tel': '15813395296',\n",
       "    'direction': '西南',\n",
       "    'distance': '8.10295',\n",
       "    'location': '113.679226,23.632528',\n",
       "    'address': '温泉镇博学路882号(广州南方学院商业中心1层)',\n",
       "    'poiweight': '0.317505',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU92JD',\n",
       "    'name': '广州南方学院教学楼1号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '西',\n",
       "    'distance': '241.753',\n",
       "    'location': '113.677077,23.631783',\n",
       "    'address': '博学路19号',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGDU8UYP',\n",
       "    'name': '广州南方学院继续教育学院招生办',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '254.238',\n",
       "    'location': '113.679075,23.634853',\n",
       "    'address': '中山路',\n",
       "    'poiweight': '0.191229',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFLBEOND',\n",
       "    'name': '聚贤楼10号',\n",
       "    'type': '商务住宅;住宅区;宿舍',\n",
       "    'tel': [],\n",
       "    'direction': '东南',\n",
       "    'distance': '263.444',\n",
       "    'location': '113.681253,23.631036',\n",
       "    'address': '从莞深高速(广州南方学院)',\n",
       "    'poiweight': '0.190963',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKP81F0',\n",
       "    'name': '教学楼1号(文学与传媒学院)',\n",
       "    'type': '科教文化服务;科教文化场所;科教文化场所',\n",
       "    'tel': [],\n",
       "    'direction': '西',\n",
       "    'distance': '263.674',\n",
       "    'location': '113.676866,23.631736',\n",
       "    'address': '博学路19号附近',\n",
       "    'poiweight': '0.191742',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD58UTU',\n",
       "    'name': '广州南方学院2号教学楼',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '西南',\n",
       "    'distance': '264.846',\n",
       "    'location': '113.677060,23.631346',\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.191229',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0FFKP838K',\n",
       "    'name': '教学楼3号(外国语学院)',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': [],\n",
       "    'direction': '西南',\n",
       "    'distance': '275.62',\n",
       "    'location': '113.677247,23.630947',\n",
       "    'address': '博学路25',\n",
       "    'poiweight': '0.191742',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD588HJ',\n",
       "    'name': '广州南方学院教学楼4号',\n",
       "    'type': '科教文化服务;学校;学校',\n",
       "    'tel': [],\n",
       "    'direction': '西南',\n",
       "    'distance': '297.315',\n",
       "    'location': '113.677460,23.630490',\n",
       "    'address': '博学路',\n",
       "    'poiweight': '0.221662',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0GUJYPEG2',\n",
       "    'name': '怒烤烤串(从化店)',\n",
       "    'type': '餐饮服务;中餐厅;特色/地方风味餐厅',\n",
       "    'tel': [],\n",
       "    'direction': '西',\n",
       "    'distance': '219.859',\n",
       "    'location': '113.677160,23.632910',\n",
       "    'address': '温泉大道882号广州南方学院内博学路6号之3',\n",
       "    'poiweight': '0.216026',\n",
       "    'businessarea': []},\n",
       "   {'id': 'B0HGD576F1',\n",
       "    'name': '广州南方学院音乐系',\n",
       "    'type': '科教文化服务;学校;高等院校',\n",
       "    'tel': [],\n",
       "    'direction': '北',\n",
       "    'distance': '316.942',\n",
       "    'location': '113.678792,23.635389',\n",
       "    'address': '中山路',\n",
       "    'poiweight': '0.285712',\n",
       "    'businessarea': []}],\n",
       "  'roads': [{'id': '020F49F0050461206',\n",
       "    'name': '博学路',\n",
       "    'direction': '南',\n",
       "    'distance': '156.951',\n",
       "    'location': '113.68,23.634'},\n",
       "   {'id': '020F49F0050462451',\n",
       "    'name': '中山路',\n",
       "    'direction': '东南',\n",
       "    'distance': '343.951',\n",
       "    'location': '113.677,23.6347'},\n",
       "   {'id': '020F49F006047765',\n",
       "    'name': 'S29从莞深高速',\n",
       "    'direction': '南',\n",
       "    'distance': '807.947',\n",
       "    'location': '113.682,23.6394'}],\n",
       "  'roadinters': [{'direction': '东南',\n",
       "    'distance': '343.951',\n",
       "    'location': '113.676794,23.634661',\n",
       "    'first_id': '020F49F0050461206',\n",
       "    'first_name': '博学路',\n",
       "    'second_id': '020F49F0050462451',\n",
       "    'second_name': '中山路'}],\n",
       "  'aois': [{'id': 'B00140MR9A',\n",
       "    'name': '广州南方学院',\n",
       "    'adcode': '440117',\n",
       "    'location': '113.679257,23.632577',\n",
       "    'area': '528560.656426',\n",
       "    'distance': '0',\n",
       "    'type': '141201'}]}}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "d827a25d",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1.调用requests模块（google chrome浏览器）\n",
    "import requests\n",
    "\n",
    "# 2.请求方法：GET\n",
    "\n",
    "# 3.URL地址：https://restapi.amap.com/v5/place/text?parameters \n",
    "regeo_url = \"https://restapi.amap.com/v5/place/text?parameters\"\n",
    "\n",
    "# 4.准备参数，用于交换数据 payload\n",
    "payload ={\n",
    "    \"key\":\"63828d7ead48d69fa71280667a6f3145\",\n",
    "    \"location\":广州南方学院_location,\n",
    "    \"types\":\"中餐厅|西餐厅|快餐厅\",\n",
    "    \"extensions\":\"all\",\n",
    "    \"poitype\":\"true\"\n",
    "}\n",
    "\n",
    "# 5.发起请求\n",
    "r = requests.get(url=regeo_url,params = payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "90968dc7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Response [200]>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "f15117c1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'status': '1',\n",
       " 'info': 'OK',\n",
       " 'infocode': '10000',\n",
       " 'pois': [{'name': 'Uni-hotel西餐',\n",
       "   'id': 'B0GR3OMDZ2',\n",
       "   'location': '113.679222,23.632671',\n",
       "   'type': '餐饮服务;外国餐厅;西餐厅(综合风味)',\n",
       "   'typecode': '050201',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉区广州南方学院',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '东记乡村美食',\n",
       "   'id': 'B0G3APADKJ',\n",
       "   'location': '113.679283,23.632572',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇广州南方学院后门润泰超市1层05号商铺',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '湖边纸包鱼',\n",
       "   'id': 'B0FFL7NUA2',\n",
       "   'location': '113.679861,23.630285',\n",
       "   'type': '餐饮服务;中餐厅;四川菜(川菜)',\n",
       "   'typecode': '050102',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '广州南方学院',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '壹休盖饭',\n",
       "   'id': 'B0HRHG0RSP',\n",
       "   'location': '113.679611,23.630517',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇乌土村上围2队13号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '幸福楼酒店(温泉东路)',\n",
       "   'id': 'B00140FG8A',\n",
       "   'location': '113.654186,23.644836',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇温泉东路99号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '佳乐堡',\n",
       "   'id': 'B0FFKT7WD8',\n",
       "   'location': '113.675576,23.620716',\n",
       "   'type': '餐饮服务;快餐厅;快餐厅',\n",
       "   'typecode': '050300',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇乌土村松浪队',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '柏如酒店',\n",
       "   'id': 'B00140H67T',\n",
       "   'location': '113.644626,23.638736',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉天湖路九号之一',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '天天酒家(温泉东路)',\n",
       "   'id': 'B00140LJS7',\n",
       "   'location': '113.657777,23.640442',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇牌坊东路45号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '怡东楼',\n",
       "   'id': 'B0G0O5VQRS',\n",
       "   'location': '113.653053,23.653028',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅|住宿服务;宾馆酒店;宾馆酒店',\n",
       "   'typecode': '050100|100100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉东路113号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'},\n",
       "  {'name': '碧溪农家菜',\n",
       "   'id': 'B00140H71J',\n",
       "   'location': '113.654796,23.644038',\n",
       "   'type': '餐饮服务;中餐厅;中餐厅',\n",
       "   'typecode': '050100',\n",
       "   'pname': '广东省',\n",
       "   'cityname': '广州市',\n",
       "   'adname': '从化区',\n",
       "   'address': '温泉镇碧泉路8号',\n",
       "   'pcode': '440000',\n",
       "   'citycode': '020',\n",
       "   'adcode': '440117'}],\n",
       " 'count': '10'}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "145f08e5",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
